/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.gen2phen.labs.domain;

import java.util.ArrayList;

/**
 *
 * @author pedrolopes
 *
 * GEN2PHEN Semantic Web Labs: Knowledge Netowork
 *
 */
public class Drug {

    private String description;
    private String name;
    private ArrayList<Disease> diseases = new ArrayList<Disease>();
    private String pharma;
    private String indication;

    public Drug() {
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public ArrayList<Disease> getDiseases() {
        return diseases;
    }

    public void setDiseases(ArrayList<Disease> diseases) {
        this.diseases = diseases;
    }

    public String getIndication() {
        return indication;
    }

    public void setIndication(String indication) {
        this.indication = indication;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPharma() {
        return pharma;
    }

    public void setPharma(String pharma) {
        this.pharma = pharma;
    }

    public Drug(String description, String name, String pharma, String indication) {
        this.description = description;
        this.name = name;
        this.pharma = pharma;
        this.indication = indication;
    }

    /**
     * Associates a given Disease with the Drug
     *
     * @param d The Disease.
     * @return Success of the operation.
     */
    public boolean addDisease(Disease d) {
        boolean success = false;

        try {
            diseases.add(d);    // add Disease to Drug disease array list
            success = true;
        } catch (Exception e) {
            System.out.println("[Drug] error " + e.toString());
        }

        return success;
    }

    /**
     * Overriden toString method to include all available Drug information.
     * 
     * @return
     */
    @Override
    public String toString() {
        return "\n\t\t * " + this.name + "\n\t\t * " + this.description + "\n\t\t * " + this.indication + "\n\t\t * " + this.pharma;
    }
}
